package Disizhou;

import java.util.Arrays;

public class Charupaixu {
    public static void main(String[] args) {
        int[] arr = {13, 23, 45, 65, 76, 87, 98};
        System.out.println("Arrays.toString() = " + Arrays.toString(arr));
        sort(arr);
        System.out.println("Arrays.toString(arr) = " + Arrays.toString(arr));
        int a = 2, b = 3, sum = 3;
        sum=add(a,b,sum);
        System.out.println("sum = " + sum);
    }

    public static void sort(int[] a) {
        int r;
        for (int i = 0; i < a.length; i++) {
            for (int j = i; j > 0; j--) {
                if (a[j - 1] > a[j]) {
                    r = a[j - 1];
                    a[j - 1] = a[j];
                    a[j] = r;
                }
            }
        }
    }

    public static int add(int a, int b, int sum) {
        sum = a + b;
        return sum;
    }
}
